/*
 * LeftMenu.java
 *
 * Created on __DATE__, __TIME__
 */

package org.jshand.jxc.business.book.panel;

import org.jshand.jxc.business.BusinessFrame;
import org.jshand.jxc.business.book.panel.booklist.BookManager;
import org.jshand.jxc.util.SwingUtils;

/**
 *
 * @author  __USER__
 */
public class LeftMenu extends javax.swing.JPanel {

	BusinessFrame frame = null;

	/** Creates new form LeftMenu */
	public LeftMenu() {
		initComponents();
	}

	public LeftMenu(BusinessFrame frame) {
		this();
		this.frame = frame;
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		buttonGroup1 = new javax.swing.ButtonGroup();
		buttonGroup2 = new javax.swing.ButtonGroup();
		jButton1 = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();
		jButton3 = new javax.swing.JButton();
		jButton4 = new javax.swing.JButton();

		setBackground(new java.awt.Color(51, 51, 255));
		setBorder(javax.swing.BorderFactory.createCompoundBorder());
		setAutoscrolls(true);
		setMaximumSize(null);
		setName("menuPanel");

		jButton1.setText("\u501f/\u8fd8\u4e66");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});

		jButton2.setText("\u4e66\u7c4d\u7ba1\u7406");
		jButton2.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton2ActionPerformed(evt);
			}
		});

		jButton3.setText("\u5b66\u751f\u7ba1\u7406");
		jButton3.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton3ActionPerformed(evt);
			}
		});

		jButton4.setText("\u6743\u9650\u7ba1\u7406");
		jButton4.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton4ActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(22, 22, 22)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addComponent(
																		jButton4)
																.addContainerGap())
												.addGroup(
														layout.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
																.addGroup(
																		layout.createSequentialGroup()
																				.addComponent(
																						jButton3)
																				.addContainerGap())
																.addGroup(
																		layout.createSequentialGroup()
																				.addGroup(
																						layout.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.TRAILING)
																								.addComponent(
																										jButton2)
																								.addComponent(
																										jButton1,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										83,
																										Short.MAX_VALUE))
																				.addGap(30,
																						30,
																						30))))));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addGap(30, 30, 30)
						.addComponent(jButton2,
								javax.swing.GroupLayout.PREFERRED_SIZE, 44,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(29, 29, 29)
						.addComponent(jButton1,
								javax.swing.GroupLayout.PREFERRED_SIZE, 44,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(31, 31, 31)
						.addComponent(jButton3,
								javax.swing.GroupLayout.PREFERRED_SIZE, 44,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(32, 32, 32)
						.addComponent(jButton4,
								javax.swing.GroupLayout.PREFERRED_SIZE, 44,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(46, Short.MAX_VALUE)));
	}// </editor-fold>
	//GEN-END:initComponents

	private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
		SwingUtils.addContentPanel(new PowerManager());
		SwingUtils.setStatusMsg("\u6743\u9650\u7ba1\u7406");
	}

	private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
		SwingUtils.addContentPanel(new StudentsManager());
		SwingUtils.setStatusMsg("\u5b66\u751f\u7ba1\u7406");
	}

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		SwingUtils.addContentPanel(new BorrowReturnManager());
		SwingUtils.setStatusMsg("\u501f\u002f\u8fd8\u4e66\u7cfb\u7edf哈哈");
	}

	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
		SwingUtils.addContentPanel(new BookManager());
		SwingUtils.setStatusMsg("图书管理系统加载完成...");
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.ButtonGroup buttonGroup1;
	private javax.swing.ButtonGroup buttonGroup2;
	private javax.swing.JButton jButton1;
	private javax.swing.JButton jButton2;
	private javax.swing.JButton jButton3;
	private javax.swing.JButton jButton4;
	// End of variables declaration//GEN-END:variables

}